<?php

/** @var \Laravel\Lumen\Routing\Router $router */

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->get('/duckery', function() use($router) {
    return 'hello';
});


#$router->get('/duckery/web/{file}', function($file) {
#	return redirect('/rule.php');
#});


$router->post('/duckery/login', ['uses'=>'LoginController@login']);

$router->post('/duckery/restricted/log', ['uses'=>'LoginController@log']);
// 三方调用
$router->post('/duckery/updateTask', ['uses' => 'TaskController@thirdCallUpdateTask']);

$router->group(
    [
        'prefix' => 'duckery/restricted',
        'middleware' => 'auth',
    ],
    function() use ($router) {
        $router->get('heartbeat', ['uses' => 'UserController@heartBeat']);
        $router->get('duck', ['uses' => 'UserController@duckInfo']);
        $router->get('feed', ['uses' => 'UserController@feedDuck']);
        $router->get('gainStar', ['uses' => 'UserController@gainStar']);
        $router->get('checkProductStar', ['uses' => 'UserController@checkStar']);
        $router->get('dressupInfo', ['uses' => 'UserController@dressupInfo']);///////////////////////////////
        $router->post('dressup', ['uses' => 'UserController@dressup']);///////////////////////////////
        // 召回鸭子
        $router->get('recallDuck', ['uses' => 'UserController@recallDuck']);
        // 驱赶偷吃的鸭子
        $router->get('driveDuck', ['uses' => 'UserController@driveDuck']);

        // 获取好友列表
        $router->get('getFriendList', ['uses' => 'FriendController@getFriendList']);///////////////////////////////
        // 拜访好友
        $router->post('visitFriend', ['uses' => 'FriendController@visitFriend']);
        // 好友喂食
        $router->post('feedFriend', ['uses' => 'FriendController@feedFriend']);

        // 记录列表
        $router->post('recordInfo', ['uses' => 'UserController@recordInfo']);

        // 任务列表
        $router->get('taskInfo', ['uses' => 'TaskController@taskInfo']);///////////////////////////////
        // 领取任务奖励
        $router->post('getTaskReward', ['uses' => 'TaskController@getTaskReward']);///////////////////////////////
        // 完成任务
        $router->post('completeTask', ['uses' => 'TaskController@completeTask']);///////////////////////////////

        // 获取任务状态
        $router->post('getTaskStatus', ['uses' => 'TaskController@getTaskStatus']);

        // 关注/取消关注
        $router->post('attention', ['uses' => 'UserController@attention']);

        // 获取follow状态
        $router->get('getFollowStatus', ['uses' => 'UserController@getFollowStatus']);

        // 兑换首页
        $router->get('exchangeIndex', ['uses' => 'ExchangeController@exchangeIndex']);
        // 兑换列表
        $router->post('exchangeList', ['uses' => 'ExchangeController@exchangeList']);
        // 兑换记录
        $router->get('exchangeRecord/{page}', ['uses' => 'ExchangeController@exchangeRecord']);
        // 兑换
        $router->post('exchange', ['uses' => 'ExchangeController@exchange']);

        $router->get('signin', ['uses' => 'UserController@signIn']);
        $router->get('signinfo', ['uses' => 'UserController@signInfo']);

        $router->get('addrList', ['uses' => 'AddressController@addrList']);
        $router->post('createAddr', ['uses' => 'AddressController@createAddr']);
        $router->post('fixAddr', ['uses' => 'AddressController@fixAddr']);
        $router->post('delAddr', ['uses' => 'AddressController@delAddr']);

        // 好友投喂记录
        $router->get('byFeed', ['uses' => 'FriendController@byFeed']);
        // 好友助力
        $router->post('helpFriend', ['uses' => 'FriendController@helpFriend']);
        $router->get('isHelpFriend', ['uses' => 'FriendController@isHelpFriend']);

        // 活跃度排行榜
        $router->get('rankOneself', ['uses' => 'RankController@rankOneself']);
        $router->get('ranks', ['uses' => 'RankController@lists']);
        $router->post('rankReceive', ['uses' => 'RankController@receiveRankReward']);
        // 各种标识
        $router->get('label', ['uses' => 'UserController@label']);

        // 红包功能相关
        $router->get('redPacket', ['uses' => 'RedPacketController@info']);
        $router->post('redPacketReceive', ['uses' => 'RedPacketController@click']);

        // 小游戏相关
        $router->get('smallGameList', ['uses' => 'SmallGameController@list']);
        $router->get('leapJumpInfo', ['uses' => 'SmallGameController@TreasureCaseProgress']);
        $router->get('leapJumpRank', ['uses' => 'SmallGameController@rank']);
        $router->post('leapJumpFinish', ['uses' => 'SmallGameController@finish']);


    }
);
